home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / film-datenbank / rexx / listall.rexx next >
OS/2 REXX Batch file  |  1995-03-09  |  1KB  |  65 lines

  1. /*============================================================================
  2.  *
  3.  *  Program:   listall.rexx
  4.  *
  5.  *  Version:   1.0
  6.  *
  7.  *  Purpose:   - get a filmography of all people that worked on a given movie
  8.  *             - get all information of any movie of a given pattern
  9.  *
  10.  *  Author:    Georg Magschok & Andre Bernhardt
  11.  *
  12.  *  Copyright (c) Andre Bernhardt 1993-94
  13.  *
  14.  *  History:
  15.  *
  16.  *============================================================================
  17.  */
  18.  
  19. options failat 255
  20. options results
  21.  
  22. parse arg line
  23.  
  24. if trim(line)='' then do
  25.  say 'LISTALL.rexx  (c) 1994 by Andre Bernhardt & Georg Magschok'
  26.  say 'usage:   rx listall [movietitle|movietitlepattern]'
  27.  exit
  28. end
  29.  
  30. /* '*' durch '#?' ersetzen */ 
  31. do while pos('*',line)>0
  32.  sternpos=pos('*',line)
  33.  line=left(line,sternpos-1)||'#?'||right(line,length(line)-sternpos)
  34. end
  35.  
  36. port_name = "MOVIEMUI"
  37.  
  38. if ( ~show( 'p', port_name ) ) then do
  39.  say "Please start MovieMUI first."
  40.  exit
  41. end
  42.  
  43. address value port_name
  44.  
  45. 'UNSELECT KEY=0' ; skey=result
  46. 'SELECT KEY='||skey||' "'||line||'" FROM MOVIE' ; numentries=result
  47.  
  48. if numentries=0 | RC~=0 then 
  49.  say 'There is no movie that matches the given title/pattern'
  50. else do
  51.  'GET "'||line||'" FROM MOVIE'
  52.  if RC=0 then do
  53.   say result
  54.   say ""
  55.  end 
  56.  do i=1 to numentries
  57.   'GETFROMSELECTION KEY='||skey||' NUMBER='||i ; person=result
  58.   dashpos=pos('===',person)
  59.   person=right(person,length(person)-dashpos+1)
  60.   say person
  61.  end
  62. end
  63. 'ENDSELECTION KEY='skey
  64. exit
  65.